﻿using Sustainalytics.Common.Services;
using Sustainalytics.Entities;

namespace Sustainalytics.ScreeningTool.Service.Map
{
    public class CriteriaResultMap : IMap<CriteriaResultDto, CriteriaResultOutput>
    {
        public CriteriaResultDto Map(CriteriaResultOutput source)
        {
            if (source == null)
                return null;

            return new CriteriaResultDto
            {
                IsValid = source.IsValid,
                Name = source.Name,
                StringValue = source.StringValue,
                FilterCriteriaId = source.FilterCriteriaId,
                FilterCriteriaGroupId = source.FilterCriteriaGroupId,
                SelectedValueInformation = source.SelectedValueInformation,
                CompaniesCount = source.CompaniesCount,
                IsTemporary = source.IsTemporary
            };
        }
    }
}
